//数组排序
function fn1() {
    let arr = [9, 23, 16, 7, 65, 4, 5, 45];
    for (let i = 0; i < arr.length - 1; i++) {
        for (let j = 0; j < arr.length - i - 1; j++) {
            if (arr[j] > arr[j + 1]) {
                let t = arr[j];
                arr[j] = arr[j + 1];
                arr[j + 1] = t;
            }
        }
    }
    document.write(arr);
    document.write('<br/>');

}
fn1();
function fn2() {
    let arr = [9, 23, 16, 7, 65, 4, 5, 45];
    arr.sort();
    console.log(arr);
}
fn2();
